<?php
namespace Admin\Controller;
use Admin\Controller;
/**
 * 单页管理
 */
class ArticleController extends BaseController
{
    public function aboutUs(){
        $article = M('about_art')->order('id desc')->limit(0,1)->select();
        foreach ($article as $v){
            $artArr[] = $v;
        }
//        var_dump($artArr);
        $this->assign('artArr',$artArr);
        $this->display();
    }

    public function chooseUs(){

        $this->display();
    }

    public function pro_dis(){
        $article = M('pro_dis_art')->order('id desc')->limit(0,1)->select();
        foreach ($article as $v){
            $artArr[] = $v;
        }
//        var_dump($artArr);
        $this->assign('artArr',$artArr);
        $this->display();
    }

    public function contact(){
        $article = M('contact_art')->order('id desc')->limit(0,1)->select();
        foreach ($article as $v){
            $artArr[] = $v;
        }
//        var_dump($artArr);
        $this->assign('artArr',$artArr);
        $this->display();
    }

    public function intro(){
        $article = M('intro_art')->order('id desc')->limit(0,1)->select();
        foreach ($article as $v){
            $artArr[] = $v;
        }
//        var_dump($artArr);
        $this->assign('artArr',$artArr);
        $this->display();
    }

    public function about_upload(){
        $text = M('about_art');
        $data = array(
            'content' => $_POST['content'],
        );
        if ($_POST['submit']=='更新'){
            if($pd = $text->add($data)){
                $this->success('更新成功!');
            }
        }
    }

    public function choose_upload(){
        $text = M('choose_art');
        $data = array(
            'content' => $_POST['content'],
        );
        if ($_POST['submit']=='更新'){
            if($pd = $text->add($data)){
                $this->success('更新成功!');
            }
        }
    }

    public function pro_dis_upload(){
        $text = M('pro_dis_art');
        $data = array(
            'content' => $_POST['content'],
        );
        if ($_POST['submit']=='更新'){
            if($pd = $text->add($data)){
                $this->success('更新成功!');
            }
        }
    }

    public function contact_upload(){
        $text = M('contact_art');
        $data = array(
            'content' => $_POST['content'],
        );
        if ($_POST['submit']=='更新'){
            if($pd = $text->add($data)){
                $this->success('更新成功!');
            }
        }
    }

    public function intro_upload(){
        $text = M('intro_art');
        $data = array(
            'content' => $_POST['content'],
        );
        if ($_POST['submit']=='更新'){
            if($pd = $text->add($data)){
                $this->success('更新成功!');
            }
        }
    }

}